<?php 
include_once("../c/config.php");
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
$shareNum=0;
$code=array();
$query=$mysqli->query("SELECT * FROM `ucard` ORDER BY `id` DESC");
while ($list=$query->fetch_array()){
    $getU=$mysqli->query("SELECT lai FROM `users` where openid='".$list['openid']."' limit 0,1 ");
    if($getU->num_rows>0){
        $getData=$getU->fetch_array();
        if ('share' == $getData['lai']){
            $code[]=$list['code'];
            
            echo $getData['lai'],'.....';
            $shareNum++;
            echo $shareNum;
            echo "<br />";
            
        }
        
    }
}

echo json_encode($code);